/*
 * @Author: your name
 * @Date: 2021-09-14 17:02:05
 * @LastEditTime: 2021-09-15 21:37:22
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bigdate\src\ntils\loginfo\typs.ts
 */

export interface LogType{
    openTime:Number,
    whiteScreenTime:Number,
    requestTime:Number | undefined,
    allloadTime:Number | undefined,
    nowTime:Number | undefined,
    mobile?:String,
    domTime?:Number
}
export type initiatorType = {
    name:String,
    // 资源加载耗时
    duration:Number,
    // 资源大小
    size:Number | String,
    // 资源所用协议
    protocol:String,
}
export interface Resource{
    xmlhttprequest:initiatorType[],
    css: initiatorType[],
    other: initiatorType[],
    script: initiatorType[],
    img: initiatorType[],
    link: initiatorType[],
    fetch: initiatorType[]
}
export interface ResourceError{
     type:String,
     url:String,
     msg:String,
     time:Number
}
// 拓展EventTarget
export interface EventTargets extends EventTarget{
    src:String,
    href:String,
    localName:String
 }

export interface JsError<T = any>{
       type:T,
       row:T,
       col:T,
       msg:T,
       url:T,
       time:Number | String

 }

export const ResourceFile = [
    '.js',
    '.ts',
    '.vue',
    '.html',
    '.css',
    '.less',
    '.scss',
]
export const typeFile = {
    '.js': 'JavaScript',
    '.ts': 'TypeScript',
    '.vue': 'Vue',
    '.html': 'Html',
    '.css': 'Css',
    '.less': 'Less',
    '.scss': 'Scss',
}